home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / catch < prev    next >
Text File  |  2001-04-06  |  1KB  |  32 lines

  1. SYNOPSIS
  2.         mixed catch (expr, expr, ...)
  3.         mixed catch (expr, expr, ... ; nolog)  EXPERIMENTAL
  4.  
  5. DESCRIPTION
  6.         Evaluate the expressions. If there is no error, 0 is returned.
  7.         If there is an error, the evaluation of the expressions stops at
  8.         that point, and a string with the error message is returned.
  9.         
  10.         System error messages start with a leading '*', user-defined
  11.         error values (other than 0) as given to throw() and raise_error() are
  12.         returned as they are.
  13.  
  14.         Normally, the caught error will be logged in the error logs for easier
  15.         debugging. If the keyword 'nolog' is given, this log is suppressed.
  16.         This is an experimental feature which might not survive for all
  17.         times.
  18.  
  19.         Catch is not really an efun, but a compiler directive.
  20.  
  21. EXAMPLE
  22.         object obj;
  23.         string err;
  24.         if (err = catch(obj = clone_object("/foo/bar/baz")))
  25.            write("Cannot clone object, reason:"+err"+\n");
  26.  
  27. HISTORY
  28.         LDMud 3.2.9 introduced the 'nolog' catch() as experimental feature.
  29.  
  30. SEE ALSO
  31.         throw(E), raise_error(E)
  32.